Integrate document-format storage into the editor#4265
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new .gdd (Graphite Document) container format alongside the legacy .graphite format, integrating asynchronous working-copy persistence and a robust undo/redo cursor mechanism via graph-storage. It adds comprehensive end-to-end round-trip tests, updates the frontend to support the new extension, and includes debugging utilities for diffing networks and registries. The review feedback highlights several performance optimization opportunities, specifically recommending the removal of redundant clones of the NodeNetwork and view settings, as well as optimizing path vector allocations during transient view state traversal.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| ..Default::default() | ||
| }; | ||
|
|
||
| document.apply_stored_document_settings(&storage.view_settings().clone()); |
There was a problem hiding this comment.
|
|
||
| use crate::messages::portfolio::document::utility_types::network_interface::storage_metadata::collect_network_view_settings; | ||
|
|
||
| let network = self.network_interface.document_network().clone(); |
There was a problem hiding this comment.
| stack.extend(self_network_metadata.persistent_metadata.node_metadata.keys().map(|node_id| { | ||
| let mut current_path: Vec<NodeId> = path.clone(); | ||
| current_path.push(*node_id); | ||
| current_path | ||
| })); |
There was a problem hiding this comment.
Cloning the path vector and pushing it to the stack for every single node (including leaf nodes) is highly inefficient. Since only nodes that represent nested networks actually need to be traversed, you can filter the keys to only those where network_metadata is Some before cloning the path. This avoids redundant vector allocations and map lookups for all leaf nodes.
stack.extend(
self_network_metadata
.persistent_metadata
.node_metadata
.iter()
.filter(|(_, meta)| meta.persistent_metadata.network_metadata.is_some())
.map(|(node_id, _)| {
let mut current_path = path.clone();
current_path.push(*node_id);
current_path
}),
);2c52d29 to
a263180
Compare
a263180 to
92d4397
Compare
92d4397 to
337c12c
Compare
No description provided.